package jiekou.homework;

/**
 * 所有角色
 */
public abstract class Role {
    private String name;
    private int level;

    public Role(){}

    public Role(String name, int level) {
        this.name = name;
        this.level = level;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public static void main(String[] args) {
        Doctor doctor = new Doctor("爱德华",12);
        doctor.selfintroduce();
        doctor.treat();

        Farmer farmer = new Farmer("莱安",9);
        farmer.selfintroduce();
        farmer.treat();
        farmer.mine();
        farmer.attack();

        Hunter hunter = new Hunter("克莱尔",15);
        hunter.selfintroduce();
        hunter.hunt();
        hunter.attack();
        
        Robber robber = new Robber("该隐",14);
        robber.selfintroduce();
        robber.Rob();
        robber.attack();

        Soldier soldier = new Soldier("安迪",15);
        soldier.selfintroduce();
        soldier.attack();
        soldier.defend();
    }
}
